package vip.specimen.system.controller.monitor;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import vip.specimen.system.common.annotation.SystemJurisdiction;
import vip.specimen.system.result.JsonResult;
import vip.specimen.system.utils.systemInfo.SystemInfo;

/**
 * *@Author: 余浪人
 * *@Date：2021/03/11 20:08
 * *@Email:yulangren520@Gmail.com
 * *@QQ:1368419640
 **/
@Api(tags = "服务器")
@RestController
@RequestMapping(value = "/monitor/server")
public class ServerMonitoringController {

    @GetMapping(value = "service")
    @RequiresPermissions(value = "monitor:server:select")
    @ApiOperation(value = "查看", notes = "获取服务器(磁盘,内存,虚拟机)信息")
    @SystemJurisdiction(resourceType = "button", permissionName = "查看服务器信息")
    public JsonResult<SystemInfo> serviceInfo() throws Exception {
        SystemInfo server = new SystemInfo();
        server.copyTo();
        return JsonResult.success(server);
    }

}
